package com.woniuxy.controller;

import com.woniuxy.controller.info.Result;
import com.woniuxy.util.ObjectRedisTemplate;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
public class TestController {
    @Resource
    private ObjectRedisTemplate objectRedisTemplate;
    @GetMapping("loginerror")
    public Result errotPage(){
        Result<String> instance = Result.getInstance(String.class);
        instance.setData("登录错误页面").setMsg("没有登录").setCode(403);

        return instance;
    }

    @GetMapping("test/{value}")
    public Result testTemplate(@PathVariable("value") String value ){
        objectRedisTemplate.opsForValue().set("days",value);
        return Result.getInstance();
    }

}
